const ENV = process.env.NODE_ENV;
if (ENV !== "production" && ENV !== "test" && typeof console !== "undefined" && console.warn && typeof window !== "undefined") {
  console.warn("You are using a whole package of vcu-mobile, " + "please use https://www.npmjs.com/package/babel-plugin-import to reduce app bundle size.");
}

import { App } from "vue";

//import { default as areaData } from "./area/index.js";
export type { BadgeProps } from "./badge";
import { default as Badge } from "./badge";

export type { ButtonType, ButtonSize } from "./button";
import { default as Button } from "./button";

import { default as Calendar } from "./calendar";

export type { cardHeaderType } from "./card";
import { default as Card } from "./card";

export type { CascaderOption, CascaderFieldNames } from "./cascader";
import { default as Cascader } from "./cascader";

export type { CellSize, CellArrowDirection } from "./cell";
import { default as Cell } from "./cell";

import { default as CellGroup } from "./cell-group";

export type { CheckerLabelPosition, CheckerDirection, CheckerShape, CheckboxProps, CheckboxInstance } from "./checkbox";
import { default as Checkbox } from "./checkbox";

export type { CheckboxGroupInstance, CheckboxGroupToggleAllOptions, CheckboxGroupProps } from "./checkbox-group";
import { default as CheckboxGroup } from "./checkbox-group";

export type { CircleStartPosition } from "./circle";
import { default as Circle } from "./circle";

import { default as Collapse } from "./collapse";

import { default as CollapseItem } from "./collapse-item";

export type { DatetimePickerType, DatetimePickerInstance, DatetimePickerProps } from "./datetime-picker";
import { default as DatetimePicker } from "./datetime-picker";

export type { DialogTheme, DialogMessage, DialogOptions, DialogMessageAlign } from "./dialog";
import { default as Dialog } from "./dialog";

export type { DividerContentPosition } from "./divider";
import { default as Divider } from "./divider";

export type { DropdownItemInstance, DropdownItemOption, DropdownItemProps } from "./dropdown-item";
import { default as DropdownItem } from "./dropdown-item";

export type { DropdownMenuDirection, DropdownMenuProps } from "./dropdown-menu";
import { default as DropdownMenu } from "./dropdown-menu";

import { default as Empty } from "./empty";

export type {
  InputProps,
  InputType,
  InputRule,
  InputInstance,
  InputTextAlign,
  InputClearTrigger,
  InputFormatTrigger,
  InputValidateError,
  InputAutosizeConfig,
  InputValidateTrigger,
} from "./input";
import { default as Input } from "./input";

export type { FormProps, FormInstance } from "./form";
import { default as Form } from "./form";

export type { GridDirection } from "./grid";
import { default as Grid } from "./grid";

import { default as GridItem } from "./grid-item";

import { default as Icon } from "./icon";

export type { ImageFit, ImagePosition } from "./image";
import { default as Image } from "./image";

export type { ImagePreviewProps, ImagePreviewOptions, ImagePreviewInstance, ImagePreviewScaleEventParams } from "./image-preview";
import { default as ImagePreview } from "./image-preview";

import { default as IndexAnchor } from "./index-anchor";

export type { IndexBarProps, IndexBarInstance } from "./index-bar";
import { default as IndexBar } from "./index-bar";

//import { default as Lazyload } from "./lazyload";

export type { ListInstance, ListDirection, ListProps } from "./list";
import { default as List } from "./list";

export type { LoadingType } from "./loading";
import { default as Loading } from "./loading";

import { default as NavBar } from "./nav-bar";

import { default as NoticeBar } from "./notice-bar";

export type { NotifyType, NotifyOptions, NotifyPosition } from "./notify";
import { default as Notify } from "./notify";

export type { NumberKeyboardTheme } from "./number-keyboard";
import { default as NumberKeyboard } from "./number-keyboard";

import { default as Overlay } from "./overlay";

export type { PaginationMode } from "./pagination";
import { default as Pagination } from "./pagination";

import { default as PasswordInput } from "./password-input";

export type {
  PickerProps,
  PickerColumn,
  PickerOption,
  PickerInstance,
  PickerFieldNames,
  PickerObjectColumn,
  PickerObjectOption,
  PickerToolbarPosition,
} from "./picker";
import { default as Picker } from "./picker";

export type { PopoverTheme, PopoverAction, PopoverTrigger, PopoverPlacement } from "./popover";
import { default as Popover } from "./popover";

export type { PopupPosition, PopupCloseIconPosition } from "./popup";
import { default as Popup } from "./popup";

export type { ProgressProps, ProgressInstance } from "./progress";
import { default as Progress } from "./progress";

import { default as PullRefresh } from "./pull-refresh";

export type { RadioShape, RadioLabelPosition } from "./radio";
import { default as Radio } from "./radio";

export type { RadioGroupDirection } from "./radio-group";
import { default as RadioGroup } from "./radio-group";

import { default as Rate } from "./rate";

export type { FlexboxAlign, FlexboxJustify } from "./flexbox";
import { default as Flexbox } from "./flexbox";

import { default as FlexboxItem } from "./flexbox-item";

export type { SearchProps, SearchShape, SearchInstance } from "./search";
import { default as Search } from "./search";

import { default as Sidebar } from "./sidebar";

import { default as SidebarItem } from "./sidebar-item";

import { default as Slider } from "./slider";

export type { StepsDirection } from "./steps";
import { default as Steps } from "./steps";

import { default as Step } from "./step";

export type { NumberTheme } from "./number";
import { default as Number } from "./number";

export type { StickyPosition } from "./sticky";
import { default as Sticky } from "./sticky";

export type { SwipeProps, SwipeInstance, SwipeToOptions } from "./swipe";
import { default as Swipe } from "./swipe";

export type { SwipeCellProps, SwipeCellSide, SwipeCellPosition, SwipeCellInstance } from "./swipe-cell";
import { default as SwipeCell } from "./swipe-cell";

import { default as SwipeItem } from "./swipe-item";

import { default as Switch } from "./switch";

export type { TabsProps, TabsType, TabsInstance } from "./tabs";
import { default as Tabs } from "./tabs";

import { default as Tab } from "./tab";

import { default as Tabbar } from "./tabbar";

import { default as TabbarItem } from "./tabbar-item";

export type { TagSize, TagType } from "./tag";
import { default as Tag } from "./tag";

export type { ToastType, ToastOptions, ToastPosition } from "./toast";
import { default as Toast } from "./toast";

export type { randomObj, expandTreeKey, sortColumn, column, fixedColumns } from "./table";
import { default as Table } from "./table";

export type { TreeSelectItem, TreeSelectChild } from "./tree-select";
import { default as TreeSelect } from "./tree-select";

export type { UploaderProps, UploaderInstance, UploaderResultType, UploaderFileListItem } from "./uploader";
import { default as Uploader } from "./uploader";

export type { ActionSheetProps, ActionSheetAction, ActionSheetThemeVars } from "./action-sheet";
import { default as ActionSheet } from "./action-sheet";

import { default as Locale } from "./locale";

//Qrcode 二维码
//CellFormPreview 预览单元表单
const components = [
  ActionSheet,
  Badge,
  Button,
  Calendar,
  Card,
  Cascader,
  Cell,
  CellGroup,
  Checkbox,
  CheckboxGroup,
  Circle,
  Collapse,
  CollapseItem,
  DatetimePicker,
  Dialog,
  Divider,
  DropdownItem,
  DropdownMenu,
  Empty,
  Input,
  Form,
  Grid,
  GridItem,
  Icon,
  Image,
  ImagePreview,
  IndexAnchor,
  IndexBar,
  List,
  Loading,
  NavBar,
  NoticeBar,
  Notify,
  NumberKeyboard,
  Overlay,
  Pagination,
  PasswordInput,
  Picker,
  Popover,
  Popup,
  Progress,
  PullRefresh,
  Radio,
  RadioGroup,
  Rate,
  Flexbox,
  FlexboxItem,
  Search,
  Sidebar,
  SidebarItem,
  Slider,
  Steps,
  Step,
  Number,
  Sticky,
  Swipe,
  SwipeCell,
  SwipeItem,
  Switch,
  Tabs,
  Tab,
  Tabbar,
  TabbarItem,
  Tag,
  Toast,
  Table,
  TreeSelect,
  Uploader,
];

const install = function (app: App) {
  components.forEach((component) => {
    app.use(component);
  });

  //app.config.globalProperties.$message = message;
  return app;
};

/* istanbul ignore if */

export {
  install,
  //areaData,
  ActionSheet,
  Badge,
  Button,
  Calendar,
  Card,
  Cascader,
  Cell,
  CellGroup,
  Checkbox,
  CheckboxGroup,
  Circle,
  Collapse,
  CollapseItem,
  DatetimePicker,
  Dialog,
  Divider,
  DropdownItem,
  DropdownMenu,
  Empty,
  Input,
  Form,
  Grid,
  GridItem,
  Icon,
  Image,
  ImagePreview,
  IndexAnchor,
  IndexBar,
  List,
  Loading,
  NavBar,
  NoticeBar,
  Notify,
  NumberKeyboard,
  Overlay,
  Pagination,
  PasswordInput,
  Picker,
  Popover,
  Popup,
  Progress,
  PullRefresh,
  Radio,
  RadioGroup,
  Rate,
  Flexbox,
  FlexboxItem,
  Search,
  Sidebar,
  SidebarItem,
  Slider,
  Steps,
  Step,
  Number,
  Sticky,
  Swipe,
  SwipeCell,
  SwipeItem,
  Switch,
  Tabs,
  Tab,
  Tabbar,
  TabbarItem,
  Tag,
  Toast,
  Table,
  TreeSelect,
  Uploader,
  Locale,
  //Lazyload,
};

export default {
  install,
};
